package zhtt.security.service;

import org.springframework.security.access.prepost.PreAuthorize;
import zhtt.security.domain.User;

/**
 * Created by ztt on 2018/4/30.
 */
public class ExpressionSecuredUserService implements UserService{

    @Override
    @PreAuthorize("(hasRole('ROLE_USER') and #user.username.length() le 14) or hasRole('ROLE_PREMIUM')")
    public void addUser(User user) {
        System.out.println("Method was called successfully");
    }
}
